<?php defined('SYSPATH') or die('No direct access allowed.');

class Model_Product extends ORM
{
    protected $_db = 'default';
    
    public function rules()
    {
        return array(
        	'name' => array(
        		array('not_empty')
        	),
            'href' => array(
                array('not_empty'),
                array('regex', array(':value', '|^[a-zA-Z0-9а-яА-Я\-\/]+$|u'))
            ),
            'type' => array(
        		array('not_empty')
        	),
        	'sex' => array(
        		array('not_empty')
        	),
        	'size' => array(
        		array('not_empty')
        	),
        	'width' => array(
        		array('not_empty'),
        		array('numeric')
        	),
        	'height' => array(
        		array('not_empty'),
        		array('numeric')
        	),
			'price' => array(
        		array('regex', array(':value', '|^[\d\.]*$|'))
        	),
        	'quantity' => array(
        		array('digit')
        	),
        );
    }
}